Automatic tube compensation